home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1998 #1
/
Amiga Plus 1998 #1.iso
/
demo-versionen
/
haage&partner
/
warpup-warpos
/
source
/
pixelomania.p
< prev
next >
Wrap
Text File
|
1997-09-24
|
5KB
|
169 lines
incdir include:
incdir lvo:
** '(C) Copyright 1997 Haage & Partner Computer GmbH'
** All Rights Reserved
include intuition/intuition.i
include devices/timer.i
include powerpc/ppcmacros.i
include powerpc/powerpc.i
include exec_lib.i
include dos_lib.i
include intuition_lib.i
include graphics_lib.i
include powerpc_lib.i
xref _PowerPCBase
xref _SysBase
xref _DOSBase
xref _LinkerDB
smalldata
executable
escapestr
section "PixelOMania",code
WINDOWWIDTH = 200
WINDOWHEIGHT = 100
start
prolog
pushgpr r26-r31
la r6,int_name
li r3,0
RUN68K _SysBase,OpenLibrary
tstw r3
beq .end
sw r3,_IntuitionBase
la r6,gfx_name
li r3,0
RUN68K _SysBase,OpenLibrary
tstw r3
beq .closeint
sw r3,_GfxBase
la r4,title
la r22,Args
RUN68K_XL _DOSBase,VPrintf
li r5,0
la r6,WindowTags
RUN68K _IntuitionBase,OpenWindowTagList
tstw r3
beq .closegfx
sw r3,_Window
lwz r31,wd_UserPort(r3)
lwz r29,wd_RPort(r3)
sw r29,_RPort
li r30,0
li r28,0
li r27,0
li r26,1
la r4,TimeVal1
CALLPOWERPC GetSysTimePPC
.loop
mr r5,r31
RUN68K _SysBase,GetMsg
tstw r3
beq .nomsg
lwz r4,im_Class(r3)
liw r5,IDCMP_MOUSEBUTTONS
and. r4,r4,r5
beq .nomsg
li r30,-1
mr r6,r3
RUN68K _SysBase,ReplyMsg
.nomsg
tstw r30
bne .abort
mr r6,r29
mr r3,r26
xori r26,r26,2
RUN68K _GfxBase,SetAPen
mr r6,r29
mr r3,r27
mr r4,r28
RUN68K _GfxBase,WritePixel
addi r27,r27,1
cmplwi r27,WINDOWWIDTH
blt .loop
li r27,0
addi r28,r28,1
cmplwi r28,WINDOWHEIGHT
blt .loop
la r4,TimeVal2
CALLPOWERPC GetSysTimePPC
la r4,TimeVal2
la r5,TimeVal1
CALLPOWERPC SubTimePPC
la r4,TimeVal2
lwz r0,TV_MICRO(r4)
push r0
lwz r0,TV_SECS(r4)
push r0
la r4,time
mr r22,local
RUN68K_XL _DOSBase,VPrintf
addi local,local,8
b .close
.abort
la r4,abort
la r22,Args
RUN68K_XL _DOSBase,VPrintf
.close
lw r5,_Window
RUN68K _IntuitionBase,CloseWindow
.closegfx
lw r6,_GfxBase
RUN68K _SysBase,CloseLibrary
.closeint
lw r6,_IntuitionBase
RUN68K _SysBase,CloseLibrary
.end
popgpr
epilog
section "PixelOMania",data
int_name INTNAME
gfx_name GRAFNAME
title dc.b "\nPixelOMania V1.0 18.9.97 by Sam Jordan\n"
dc.b "---------------------------------------\n"
dc.b "Measures the performance of CPU context switches\n"
dc.b "In every iteration (for every pixel) four AMIGAOS\n"
dc.b "system functions are called by the PowerPC\n\n"
dc.b "Click on the window to abort the program\n"
dc.b "Let's go:\n\n",0
abort dc.b "Program aborted\n",0
time dc.b "Time elapsed: %ld.%06ld seconds\n\n",0
cnop 0,4
WindowTags dc.l WA_Left
dc.l 100
dc.l WA_Top
dc.l 100
dc.l WA_Width
dc.l WINDOWWIDTH
dc.l WA_Height
dc.l WINDOWHEIGHT
dc.l WA_Activate
dc.l -1
dc.l WA_IDCMP
dc.l IDCMP_MOUSEBUTTONS
dc.l TAG_DONE
section "PixelOMania",bss
_IntuitionBase ds.l 1
_GfxBase ds.l 1
_Window ds.l 1
_RPort ds.l 1
TimeVal1 ds.b TV_SIZE
TimeVal2 ds.b TV_SIZE
Args ds.l 2